package com.tentcoo.core.event.demo;

import com.tentcoo.core.event.EventRaiser;
import com.tentcoo.util.AssertUtils;

public class EventRaiserDemo extends EventRaiser {

	private int n;

	public EventRaiserDemo(int n) {
		AssertUtils.isTrue(n > 0);
		this.n = n;
	}

	public long factorial() {
		long result = 1;
		for (int i = 1; i <= this.n; i++) {
			result *= i;
		}
		return result;
	}

	public int getN() {
		return this.n;
	}

	public void setN(int n) {
		this.n = n;
	}

}
